<%--
  Created by IntelliJ IDEA.
  User: Master
  Date: 17.02.2011
  Time: 15:38:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.transcargo.users.Contact" %>
<%@ page import="com.transcargo.users.User" %>
<%@ page import="com.transcargo.users.Transport" %>
<%@ page import="com.transcargo.errors.ErrorList" %>
<%@include file="header.jsf"%>
<%@include file="session.jsf"%>
<%
    if (User_Id <= 0) {
        response.sendRedirect("auth.jsp");
        return;
    }
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  	<head><title>TransCargo</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function gouser()
{
    window.location='trucks.jsp';
}
</script>
	<script type="text/javascript" src="forms.js"></script>
	<link type="text/css" href="transcargo.css" rel="stylesheet"/>
  </head>
  <body>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr><td>
			<%@include file="page_header.jsf"%>
        </td></tr>
        <tr><td align="center">
            Добавление собственного транспорта для <%=user.getName()%><br><br>
			<div id="ErrorPlaceHolder" class="errorString"></div>
            <form action="AddTruckAction" method="POST" target="ifPost">
            <table border="0" cellpadding="0" cellspacing="0">
                <tr><td class="tdFormSearch"><b>Тип транспорта:</b></td><td align="left"><select name="cargo_type" id="cargo_type" class="selNormal">
					<%
					        iter = null;
					        list = dbase.execute("SELECT id, name from transport_type");
					        if (list != null) iter = list.iterator();
					        if (iter != null) {
					            int i = 0;
					            while (iter.hasNext()) {
					                String[] str = iter.next();
					                %><option value="<%=str[0]%>"><%=str[1]%></option><%
					                i++;
					            }
					        }
					%>
				    </select></td></tr>
                <tr><td class="tdFormSearch"><b>Тип загрузки:</b></td><td align="left">
                    <%
				        iter = null;
				        list = dbase.execute("SELECT id, name from transport_loading");
				        if (list != null) iter = list.iterator();
			            while (iter.hasNext()) {
			                String[] str = iter.next();
			                %><input type="checkbox" name="load<%=str[0]%>"><%=str[1]%><br><%
			            }
				%>
                </td></tr>
                <tr class="tdFormSearch"><td><b>Объем:</b></td><td align="left"><input name="volume" size="10"> м<sup>3</sup></td></tr>
                <tr class="tdFormSearch"><td><b>Тоннаж:</b></td><td align="left"><input name="tonnage" size="10"> т.</td></tr>
                <tr class="tdFormSearch"><td>Длина:</td><td align="left"><input name="length" size="10"> м.</td></tr>
                <tr class="tdFormSearch"><td>Высота:</td><td align="left"><input name="height" size="10"> м.</td></tr>
                <tr class="tdFormSearch"><td>Ширина:</td><td align="left"><input name="width" size="10"> м.</td></tr>
                <tr class="tdFormSearch"><td>TIR Carnet:</td><td align="left"><input type="checkbox" name="tir"></td></tr>
                <tr class="tdFormSearch"><td>EKMT:</td><td align="left"><input type="checkbox" name="ekmt"></td></tr>
                <tr class="tdFormSearch"><td>Класс ADR:</td><td align="left"><select name="adr">
                    <option value="">-</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                </select></td></tr>
                <tr><td class="tdFormSearch"><input type="submit" value="Продолжить"></td><td align="left"><input type="submit" value="Отмена" onclick="gouser();return false;"></td></tr>
            </table>
            </form>
        </td></tr>
        </table>
	<iframe name="ifPost" id="ifPost" width="0" height="0" style="visibility: hidden;width: 0;height: 0;" onload="handlePost(this);" onload="handlePost(this);"></iframe>

  </body>
</html>
